<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>主页面</title>
<style type="text/css">
table.gridtable {
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	color: #333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}

table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}

table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}

tr:hover td {
	background: none;
}

tr:hover {
	background-color: none;
}

thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

table {
	border-collapse: collapse;
	width: 100%;
}

th, td {
	padding: 8px;
	text-align: left;
}

th {
	background-color: #f2f2f2;
}

#myDiv1{
	background-color: #f1f1f1;
	padding: 10px;
}
#myDiv2{
	background-color: #f1f1f1;
	padding: 10px;
}

#myDiv3{
	background-color: #f1f1f1;
	padding: 10px;
}


.popup {
	width: 1000px;
	height: 700px;
	background-color: #f1f1f1;
	border: 1px solid #ccc;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.close-btn {
	position: absolute;
	top: 0;
	right: 0;
	padding: 10px;
	cursor: pointer;
	font-size: 20px;
	color: #aaa;
}
</style>
<meta charset="UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/grid1.0.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/echarts.min.js"></script>
</head>
<body>

	<input type="text" style="width:300px;" id="text1" value="算力,AI,DeepSeek,固态电池,机器人,零售"> <button id="bt1">查询TOP100亿10天内没有超过7的及三天内总跌-17%</button>
	<button id="bt2">查询TOP1001三连跌超过17%</button>
	<div id="div2-3"></div>
	<div id="div2-4"></div>
	<div id="myDiv"></div>
	 

	<script type="text/javascript">

(function(){ 
	
	
	$("#bt1").click(function(){
		aaa();
	});
	$("#bt2").click(function(){
		bbb();
	});
	function aaa(){
		var text17 = $("#text1").val(); 
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTop100",
				dataType : 'text', 
				data:{gn:$("#text1").val()},
				success : function(msg) {  
					$("#myDiv").html(msg);
					$("#mytalbe").addClass("gridtable");  
					 $("#mytalbe td[name=zhangdiefu]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=huanshoulv]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=jiage]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=jinkai]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=zuidi]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=dqj]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $('#mytalbe tbody tr').sort(function(a, b) {
					        return parseFloat($('td[name=zhangdiefu]', b).text()) - parseFloat($('td[name=zhangdiefu]', a).text());
					    }).appendTo('table tbody');
					 
				} 
			}); 
	}
	function bbb(){
		var text17 = $("#text1").val(); 
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTop1001",
				dataType : 'text', 
				data:{gn:$("#text1").val()},
				success : function(msg) {  
					$("#myDiv").html(msg);
					$("#mytalbe").addClass("gridtable");  
					 $("#mytalbe td[name=zhangdiefu]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=huanshoulv]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=jiage]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=jinkai]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=zuidi]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $("#mytalbe td[name=dqj]:not(:first)").each(function(){ 
						 var num = parseFloat($(this).text()); 
					        var roundedNum = num.toFixed(2);
					        $(this).text(roundedNum);
					 });
					 $('#mytalbe tbody tr').sort(function(a, b) {
					        return parseFloat($('td[name=zhangdiefu]', b).text()) - parseFloat($('td[name=zhangdiefu]', a).text());
					    }).appendTo('table tbody');
					 
				} 
			}); 
	}
	 
	//aaa();
	
	 
})();
</script>
</body>
</html>